(0) Obligation:

Clauses:

ordered([]) :- !.
ordered(.(X1, [])) :- !.
ordered(Xs) :- ','(head(Xs, X), ','(tail(Xs, Ys), ','(head(Ys, Y), ','(tail(Ys, Zs), ','(less(X, s(Y)), ordered(.(Y, Zs))))))).
head([], X2).
head(.(X, X3), X).
tail([], []).
tail(.(X4, Xs), Xs).
less(0, Y) :- ','(!, eq(Y, s(X5))).
less(X, Y) :- ','(p(X, Px), ','(p(Y, Py), less(Px, Py))).
p(0, 0).
p(s(X), X).
eq(X, X).

Query: ordered(g)

(1) PrologToDTProblemTransformerProof (SOUND transformation)

Built DT problem from termination graph DT10.

(2) Obligation:

Triples:

lessC(s(X1)) :- lessC(X1).
lessD(s(X1), 0) :- lessC(X1).
lessD(s(X1), s(X2)) :- lessD(X1, X2).
orderedA(.(s(X1), .(X2, X3))) :- lessD(X1, X2).
orderedA(.(X1, .(X2, X3))) :- ','(lesscB(X1, X2), orderedA(.(X2, X3))).

Clauses:

orderedcA([]).
orderedcA(.(X1, [])).
orderedcA(.(X1, .(X2, X3))) :- ','(lesscB(X1, X2), orderedcA(.(X2, X3))).
lesscC(s(X1)) :- lesscC(X1).
lesscD(0, s(X1)).
lesscD(s(X1), 0) :- lesscC(X1).
lesscD(s(X1), s(X2)) :- lesscD(X1, X2).
lesscB(0, X1).
lesscB(s(X1), X2) :- lesscD(X1, X2).

Afs:

orderedA(x1)  =  orderedA(x1)

(3) TriplesToPiDPProof (SOUND transformation)

We use the technique of [DT09]. With regard to the inferred argument filtering the predicates were used in the following modes:
orderedA_in: (b)
lessD_in: (b,b)
lessC_in: (b)
lesscB_in: (b,b)
lesscD_in: (b,b)
lesscC_in: (b)
Transforming TRIPLES into the following Term Rewriting System:
Pi DP problem:
The TRS P consists of the following rules:

ORDEREDA_IN_G(.(s(X1), .(X2, X3))) → U4_G(X1, X2, X3, lessD_in_gg(X1, X2))
ORDEREDA_IN_G(.(s(X1), .(X2, X3))) → LESSD_IN_GG(X1, X2)
LESSD_IN_GG(s(X1), 0) → U2_GG(X1, lessC_in_g(X1))
LESSD_IN_GG(s(X1), 0) → LESSC_IN_G(X1)
LESSC_IN_G(s(X1)) → U1_G(X1, lessC_in_g(X1))
LESSC_IN_G(s(X1)) → LESSC_IN_G(X1)
LESSD_IN_GG(s(X1), s(X2)) → U3_GG(X1, X2, lessD_in_gg(X1, X2))
LESSD_IN_GG(s(X1), s(X2)) → LESSD_IN_GG(X1, X2)
ORDEREDA_IN_G(.(X1, .(X2, X3))) → U5_G(X1, X2, X3, lesscB_in_gg(X1, X2))
U5_G(X1, X2, X3, lesscB_out_gg(X1, X2)) → U6_G(X1, X2, X3, orderedA_in_g(.(X2, X3)))
U5_G(X1, X2, X3, lesscB_out_gg(X1, X2)) → ORDEREDA_IN_G(.(X2, X3))

The TRS R consists of the following rules:

lesscB_in_gg(0, X1) → lesscB_out_gg(0, X1)
lesscB_in_gg(s(X1), X2) → U13_gg(X1, X2, lesscD_in_gg(X1, X2))
lesscD_in_gg(0, s(X1)) → lesscD_out_gg(0, s(X1))
lesscD_in_gg(s(X1), 0) → U11_gg(X1, lesscC_in_g(X1))
lesscC_in_g(s(X1)) → U10_g(X1, lesscC_in_g(X1))
U10_g(X1, lesscC_out_g(X1)) → lesscC_out_g(s(X1))
U11_gg(X1, lesscC_out_g(X1)) → lesscD_out_gg(s(X1), 0)
lesscD_in_gg(s(X1), s(X2)) → U12_gg(X1, X2, lesscD_in_gg(X1, X2))
U12_gg(X1, X2, lesscD_out_gg(X1, X2)) → lesscD_out_gg(s(X1), s(X2))
U13_gg(X1, X2, lesscD_out_gg(X1, X2)) → lesscB_out_gg(s(X1), X2)

Pi is empty.
We have to consider all (P,R,Pi)-chains

Infinitary Constructor Rewriting Termination of PiDP implies Termination of TRIPLES

(4) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

ORDEREDA_IN_G(.(s(X1), .(X2, X3))) → U4_G(X1, X2, X3, lessD_in_gg(X1, X2))
ORDEREDA_IN_G(.(s(X1), .(X2, X3))) → LESSD_IN_GG(X1, X2)
LESSD_IN_GG(s(X1), 0) → U2_GG(X1, lessC_in_g(X1))
LESSD_IN_GG(s(X1), 0) → LESSC_IN_G(X1)
LESSC_IN_G(s(X1)) → U1_G(X1, lessC_in_g(X1))
LESSC_IN_G(s(X1)) → LESSC_IN_G(X1)
LESSD_IN_GG(s(X1), s(X2)) → U3_GG(X1, X2, lessD_in_gg(X1, X2))
LESSD_IN_GG(s(X1), s(X2)) → LESSD_IN_GG(X1, X2)
ORDEREDA_IN_G(.(X1, .(X2, X3))) → U5_G(X1, X2, X3, lesscB_in_gg(X1, X2))
U5_G(X1, X2, X3, lesscB_out_gg(X1, X2)) → U6_G(X1, X2, X3, orderedA_in_g(.(X2, X3)))
U5_G(X1, X2, X3, lesscB_out_gg(X1, X2)) → ORDEREDA_IN_G(.(X2, X3))

The TRS R consists of the following rules:

lesscB_in_gg(0, X1) → lesscB_out_gg(0, X1)
lesscB_in_gg(s(X1), X2) → U13_gg(X1, X2, lesscD_in_gg(X1, X2))
lesscD_in_gg(0, s(X1)) → lesscD_out_gg(0, s(X1))
lesscD_in_gg(s(X1), 0) → U11_gg(X1, lesscC_in_g(X1))
lesscC_in_g(s(X1)) → U10_g(X1, lesscC_in_g(X1))
U10_g(X1, lesscC_out_g(X1)) → lesscC_out_g(s(X1))
U11_gg(X1, lesscC_out_g(X1)) → lesscD_out_gg(s(X1), 0)
lesscD_in_gg(s(X1), s(X2)) → U12_gg(X1, X2, lesscD_in_gg(X1, X2))
U12_gg(X1, X2, lesscD_out_gg(X1, X2)) → lesscD_out_gg(s(X1), s(X2))
U13_gg(X1, X2, lesscD_out_gg(X1, X2)) → lesscB_out_gg(s(X1), X2)

Pi is empty.
We have to consider all (P,R,Pi)-chains

(5) DependencyGraphProof (EQUIVALENT transformation)

The approximation of the Dependency Graph [LOPSTR] contains 3 SCCs with 7 less nodes.

(6) Complex Obligation (AND)

(7) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

LESSC_IN_G(s(X1)) → LESSC_IN_G(X1)

The TRS R consists of the following rules:

lesscB_in_gg(0, X1) → lesscB_out_gg(0, X1)
lesscB_in_gg(s(X1), X2) → U13_gg(X1, X2, lesscD_in_gg(X1, X2))
lesscD_in_gg(0, s(X1)) → lesscD_out_gg(0, s(X1))
lesscD_in_gg(s(X1), 0) → U11_gg(X1, lesscC_in_g(X1))
lesscC_in_g(s(X1)) → U10_g(X1, lesscC_in_g(X1))
U10_g(X1, lesscC_out_g(X1)) → lesscC_out_g(s(X1))
U11_gg(X1, lesscC_out_g(X1)) → lesscD_out_gg(s(X1), 0)
lesscD_in_gg(s(X1), s(X2)) → U12_gg(X1, X2, lesscD_in_gg(X1, X2))
U12_gg(X1, X2, lesscD_out_gg(X1, X2)) → lesscD_out_gg(s(X1), s(X2))
U13_gg(X1, X2, lesscD_out_gg(X1, X2)) → lesscB_out_gg(s(X1), X2)

Pi is empty.
We have to consider all (P,R,Pi)-chains

(8) UsableRulesProof (EQUIVALENT transformation)

For (infinitary) constructor rewriting [LOPSTR] we can delete all non-usable rules from R.

(9) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

LESSC_IN_G(s(X1)) → LESSC_IN_G(X1)

R is empty.
Pi is empty.
We have to consider all (P,R,Pi)-chains

(10) PiDPToQDPProof (EQUIVALENT transformation)

Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.

(11) Obligation:

Q DP problem:
The TRS P consists of the following rules:

LESSC_IN_G(s(X1)) → LESSC_IN_G(X1)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.

(12) QDPSizeChangeProof (EQUIVALENT transformation)

By using the subterm criterion [SUBTERM_CRITERION] together with the size-change analysis [AAECC05] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:

  • LESSC_IN_G(s(X1)) → LESSC_IN_G(X1)
    The graph contains the following edges 1 > 1

(13) YES

(14) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

LESSD_IN_GG(s(X1), s(X2)) → LESSD_IN_GG(X1, X2)

The TRS R consists of the following rules:

lesscB_in_gg(0, X1) → lesscB_out_gg(0, X1)
lesscB_in_gg(s(X1), X2) → U13_gg(X1, X2, lesscD_in_gg(X1, X2))
lesscD_in_gg(0, s(X1)) → lesscD_out_gg(0, s(X1))
lesscD_in_gg(s(X1), 0) → U11_gg(X1, lesscC_in_g(X1))
lesscC_in_g(s(X1)) → U10_g(X1, lesscC_in_g(X1))
U10_g(X1, lesscC_out_g(X1)) → lesscC_out_g(s(X1))
U11_gg(X1, lesscC_out_g(X1)) → lesscD_out_gg(s(X1), 0)
lesscD_in_gg(s(X1), s(X2)) → U12_gg(X1, X2, lesscD_in_gg(X1, X2))
U12_gg(X1, X2, lesscD_out_gg(X1, X2)) → lesscD_out_gg(s(X1), s(X2))
U13_gg(X1, X2, lesscD_out_gg(X1, X2)) → lesscB_out_gg(s(X1), X2)

Pi is empty.
We have to consider all (P,R,Pi)-chains

(15) UsableRulesProof (EQUIVALENT transformation)

For (infinitary) constructor rewriting [LOPSTR] we can delete all non-usable rules from R.

(16) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

LESSD_IN_GG(s(X1), s(X2)) → LESSD_IN_GG(X1, X2)

R is empty.
Pi is empty.
We have to consider all (P,R,Pi)-chains

(17) PiDPToQDPProof (EQUIVALENT transformation)

Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.

(18) Obligation:

Q DP problem:
The TRS P consists of the following rules:

LESSD_IN_GG(s(X1), s(X2)) → LESSD_IN_GG(X1, X2)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.

(19) QDPSizeChangeProof (EQUIVALENT transformation)

By using the subterm criterion [SUBTERM_CRITERION] together with the size-change analysis [AAECC05] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:

  • LESSD_IN_GG(s(X1), s(X2)) → LESSD_IN_GG(X1, X2)
    The graph contains the following edges 1 > 1, 2 > 2

(20) YES

(21) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

ORDEREDA_IN_G(.(X1, .(X2, X3))) → U5_G(X1, X2, X3, lesscB_in_gg(X1, X2))
U5_G(X1, X2, X3, lesscB_out_gg(X1, X2)) → ORDEREDA_IN_G(.(X2, X3))

The TRS R consists of the following rules:

lesscB_in_gg(0, X1) → lesscB_out_gg(0, X1)
lesscB_in_gg(s(X1), X2) → U13_gg(X1, X2, lesscD_in_gg(X1, X2))
lesscD_in_gg(0, s(X1)) → lesscD_out_gg(0, s(X1))
lesscD_in_gg(s(X1), 0) → U11_gg(X1, lesscC_in_g(X1))
lesscC_in_g(s(X1)) → U10_g(X1, lesscC_in_g(X1))
U10_g(X1, lesscC_out_g(X1)) → lesscC_out_g(s(X1))
U11_gg(X1, lesscC_out_g(X1)) → lesscD_out_gg(s(X1), 0)
lesscD_in_gg(s(X1), s(X2)) → U12_gg(X1, X2, lesscD_in_gg(X1, X2))
U12_gg(X1, X2, lesscD_out_gg(X1, X2)) → lesscD_out_gg(s(X1), s(X2))
U13_gg(X1, X2, lesscD_out_gg(X1, X2)) → lesscB_out_gg(s(X1), X2)

Pi is empty.
We have to consider all (P,R,Pi)-chains

(22) PiDPToQDPProof (EQUIVALENT transformation)

Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.

(23) Obligation:

Q DP problem:
The TRS P consists of the following rules:

ORDEREDA_IN_G(.(X1, .(X2, X3))) → U5_G(X1, X2, X3, lesscB_in_gg(X1, X2))
U5_G(X1, X2, X3, lesscB_out_gg(X1, X2)) → ORDEREDA_IN_G(.(X2, X3))

The TRS R consists of the following rules:

lesscB_in_gg(0, X1) → lesscB_out_gg(0, X1)
lesscB_in_gg(s(X1), X2) → U13_gg(X1, X2, lesscD_in_gg(X1, X2))
lesscD_in_gg(0, s(X1)) → lesscD_out_gg(0, s(X1))
lesscD_in_gg(s(X1), 0) → U11_gg(X1, lesscC_in_g(X1))
lesscC_in_g(s(X1)) → U10_g(X1, lesscC_in_g(X1))
U10_g(X1, lesscC_out_g(X1)) → lesscC_out_g(s(X1))
U11_gg(X1, lesscC_out_g(X1)) → lesscD_out_gg(s(X1), 0)
lesscD_in_gg(s(X1), s(X2)) → U12_gg(X1, X2, lesscD_in_gg(X1, X2))
U12_gg(X1, X2, lesscD_out_gg(X1, X2)) → lesscD_out_gg(s(X1), s(X2))
U13_gg(X1, X2, lesscD_out_gg(X1, X2)) → lesscB_out_gg(s(X1), X2)

The set Q consists of the following terms:

lesscB_in_gg(x0, x1)
lesscD_in_gg(x0, x1)
lesscC_in_g(x0)
U10_g(x0, x1)
U11_gg(x0, x1)
U12_gg(x0, x1, x2)
U13_gg(x0, x1, x2)

We have to consider all (P,Q,R)-chains.

(24) MRRProof (EQUIVALENT transformation)

By using the rule removal processor [LPAR04] with the following ordering, at least one Dependency Pair or term rewrite system rule of this QDP problem can be strictly oriented.

Strictly oriented rules of the TRS R:

U11_gg(X1, lesscC_out_g(X1)) → lesscD_out_gg(s(X1), 0)

Used ordering: Polynomial interpretation [POLO]:

POL(.(x1, x2)) = 2·x1 + x2   
POL(0) = 0   
POL(ORDEREDA_IN_G(x1)) = 2·x1   
POL(U10_g(x1, x2)) = x1 + x2   
POL(U11_gg(x1, x2)) = x1 + x2   
POL(U12_gg(x1, x2, x3)) = x1 + x2 + x3   
POL(U13_gg(x1, x2, x3)) = x1 + x2 + x3   
POL(U5_G(x1, x2, x3, x4)) = 2·x1 + 2·x2 + 2·x3 + x4   
POL(lesscB_in_gg(x1, x2)) = x1 + 2·x2   
POL(lesscB_out_gg(x1, x2)) = x1 + 2·x2   
POL(lesscC_in_g(x1)) = x1   
POL(lesscC_out_g(x1)) = 1 + x1   
POL(lesscD_in_gg(x1, x2)) = x1 + x2   
POL(lesscD_out_gg(x1, x2)) = x1 + x2   
POL(s(x1)) = 2·x1   

(25) Obligation:

Q DP problem:
The TRS P consists of the following rules:

ORDEREDA_IN_G(.(X1, .(X2, X3))) → U5_G(X1, X2, X3, lesscB_in_gg(X1, X2))
U5_G(X1, X2, X3, lesscB_out_gg(X1, X2)) → ORDEREDA_IN_G(.(X2, X3))

The TRS R consists of the following rules:

lesscB_in_gg(0, X1) → lesscB_out_gg(0, X1)
lesscB_in_gg(s(X1), X2) → U13_gg(X1, X2, lesscD_in_gg(X1, X2))
lesscD_in_gg(0, s(X1)) → lesscD_out_gg(0, s(X1))
lesscD_in_gg(s(X1), 0) → U11_gg(X1, lesscC_in_g(X1))
lesscC_in_g(s(X1)) → U10_g(X1, lesscC_in_g(X1))
U10_g(X1, lesscC_out_g(X1)) → lesscC_out_g(s(X1))
lesscD_in_gg(s(X1), s(X2)) → U12_gg(X1, X2, lesscD_in_gg(X1, X2))
U12_gg(X1, X2, lesscD_out_gg(X1, X2)) → lesscD_out_gg(s(X1), s(X2))
U13_gg(X1, X2, lesscD_out_gg(X1, X2)) → lesscB_out_gg(s(X1), X2)

The set Q consists of the following terms:

lesscB_in_gg(x0, x1)
lesscD_in_gg(x0, x1)
lesscC_in_g(x0)
U10_g(x0, x1)
U11_gg(x0, x1)
U12_gg(x0, x1, x2)
U13_gg(x0, x1, x2)

We have to consider all (P,Q,R)-chains.

(26) MRRProof (EQUIVALENT transformation)

By using the rule removal processor [LPAR04] with the following ordering, at least one Dependency Pair or term rewrite system rule of this QDP problem can be strictly oriented.
Strictly oriented dependency pairs:

ORDEREDA_IN_G(.(X1, .(X2, X3))) → U5_G(X1, X2, X3, lesscB_in_gg(X1, X2))


Used ordering: Polynomial interpretation [POLO]:

POL(.(x1, x2)) = 1 + 2·x1 + 2·x2   
POL(0) = 0   
POL(ORDEREDA_IN_G(x1)) = x1   
POL(U10_g(x1, x2)) = x1 + x2   
POL(U11_gg(x1, x2)) = x1 + x2   
POL(U12_gg(x1, x2, x3)) = x1 + x2 + x3   
POL(U13_gg(x1, x2, x3)) = x1 + x2 + x3   
POL(U5_G(x1, x2, x3, x4)) = 1 + x1 + 2·x2 + 2·x3 + x4   
POL(lesscB_in_gg(x1, x2)) = x1 + 2·x2   
POL(lesscB_out_gg(x1, x2)) = x1 + 2·x2   
POL(lesscC_in_g(x1)) = x1   
POL(lesscC_out_g(x1)) = x1   
POL(lesscD_in_gg(x1, x2)) = x1 + x2   
POL(lesscD_out_gg(x1, x2)) = x1 + x2   
POL(s(x1)) = 2·x1   

(27) Obligation:

Q DP problem:
The TRS P consists of the following rules:

U5_G(X1, X2, X3, lesscB_out_gg(X1, X2)) → ORDEREDA_IN_G(.(X2, X3))

The TRS R consists of the following rules:

lesscB_in_gg(0, X1) → lesscB_out_gg(0, X1)
lesscB_in_gg(s(X1), X2) → U13_gg(X1, X2, lesscD_in_gg(X1, X2))
lesscD_in_gg(0, s(X1)) → lesscD_out_gg(0, s(X1))
lesscD_in_gg(s(X1), 0) → U11_gg(X1, lesscC_in_g(X1))
lesscC_in_g(s(X1)) → U10_g(X1, lesscC_in_g(X1))
U10_g(X1, lesscC_out_g(X1)) → lesscC_out_g(s(X1))
lesscD_in_gg(s(X1), s(X2)) → U12_gg(X1, X2, lesscD_in_gg(X1, X2))
U12_gg(X1, X2, lesscD_out_gg(X1, X2)) → lesscD_out_gg(s(X1), s(X2))
U13_gg(X1, X2, lesscD_out_gg(X1, X2)) → lesscB_out_gg(s(X1), X2)

The set Q consists of the following terms:

lesscB_in_gg(x0, x1)
lesscD_in_gg(x0, x1)
lesscC_in_g(x0)
U10_g(x0, x1)
U11_gg(x0, x1)
U12_gg(x0, x1, x2)
U13_gg(x0, x1, x2)

We have to consider all (P,Q,R)-chains.

(28) DependencyGraphProof (EQUIVALENT transformation)

The approximation of the Dependency Graph [LPAR04,FROCOS05,EDGSTAR] contains 0 SCCs with 1 less node.

(29) TRUE